class NewClock :public Clock
{
public:
	int hour;
	int minute;
	int second;
	NewClock(int h, int m, int s) :Clock(h,m,s) {
	}
	
	void showTime() {
		hour = getHour();
		minute = getMinute();
		second = getSecond();
		int tmp;
		if (hour > 11) 
		{ 
			tmp = hour - 12;
			cout << "Now:" << tmp << ":" << minute << ":" << second << "PM" << endl;
		}
		else 
		{ 
			tmp = hour; 
			cout << "Now:" << tmp << ":" << minute << ":" << second << "AM" << endl;
		}
	}
};


Clock* Clock::createNewClock(int h, int m, int s) {
	return new NewClock(h, m, s);
}